package com.audi.activity;

import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.text.Spannable;
import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
import android.widget.TextView;

import com.audi.R;
import com.audi.BaseActivity;

public class TriggerActivity extends BaseActivity {
	protected void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		setContentView(R.layout.activity_trigger);
		initActionBar(R.layout.action_bar_trigger);
		TextView status = (TextView) findViewById(R.id.txt_trigger_status);
		final Context context = this;
		status.setText("If Motion Sensor is triggered, the turn on the Lamp.",
				TextView.BufferType.SPANNABLE);
		Spannable s = (Spannable) status.getText();
		StyleSpan bss = new StyleSpan(android.graphics.Typeface.BOLD);
		s.setSpan(new ForegroundColorSpan(Color.rgb(7, 181, 213)), 3, 16, 0);
//		s.setSpan(bss, 3, 16, 0);
		s.setSpan(new ForegroundColorSpan(Color.rgb(7, 181, 213)), 20, 29, 0);
//		s.setSpan(bss, 20, 29, 0);
		s.setSpan(new ForegroundColorSpan(Color.rgb(7, 181, 213)), 34, 42, 0);
//		s.setSpan(bss, 34, 42, 0);
		s.setSpan(new ForegroundColorSpan(Color.rgb(7, 181, 213)), 46, status
				.getText().toString().length() - 1, 0);
//		s.setSpan(bss, 46, status.getText().toString().length() - 1, 0);

		// shove our styled text into the TextView
		// status.append(s);
		setDisableDrawer();
	}

	@Override
	public void onRefreshData() {
		// TODO Auto-generated method stub
		
	}
}
